package com.yami.shop.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yami.shop.bean.model.User;
import com.yami.shop.bean.model.VipPackage;
import com.yami.shop.dao.UserMapper;
import com.yami.shop.dao.VipPackageMapper;
import com.yami.shop.service.UserService;
import com.yami.shop.service.VipPackageService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * <p>
 * vip套餐 服务实现类
 * </p>
 *
 * @author chajiu
 * @since 2021-06-29
 */
@Service
public class VipPackageServiceImpl extends ServiceImpl<VipPackageMapper, VipPackage> implements VipPackageService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public int getDailyFreeUnlockNum() {
        return 10;
    }

    @Override
    public void updateDailyUnlockCount() {
        //更新正常vip的解锁次数
        userMapper.vipUpdate();
        //更新优惠vip的解锁次数
        userMapper.discountVipUpdate();

    }
}
